package com.gao.hookDemo

import org.objectweb.asm.MethodVisitor
import org.objectweb.asm.Opcodes
import org.objectweb.asm.Opcodes.INVOKESTATIC


/**
 * 文件名： <br/>
 * 描述：
 *
 * @author wulinran
 * @since 2022/11/25 16:35
 */
class AutoTraceMethodVisitor(var methodVisitor: MethodVisitor) : MethodVisitor(Opcodes.ASM7, methodVisitor) {
    private var mMethodName: String? = null
    private var mClassName: String? = null



    override fun visitCode() {
        methodVisitor.visitCode();
        methodVisitor.visitLdcInsn("TestInfo");
        methodVisitor.visitLdcInsn("i'm click");
        methodVisitor.visitMethodInsn(INVOKESTATIC, "android/util/Log", "d", "(Ljava/lang/String;Ljava/lang/String;)I", false);
        methodVisitor.visitMaxs(2, 0);
        methodVisitor.visitEnd();
    }
}